<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/sale/include/common-base.jsp"%>
  <title>申购委托查询-${titleName}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>

<!-- 以下是body主体内容的模块区域 -->
<body class="hold-transition ${sysColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left.jsp" %>
  <!-- left end-->

  <div class="content-wrapper">
    <!-- Main start -->
	<section class="content">
      <div class="row">
        <div class="col-xs-12">
        
          <!------搜索  start ------->
          <div class="box box-info">
             <!--搜索title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-search"></i> 申购管理 | ${param.proNo} | ${param.proName} </h3>
                 <div class="box-tools pull-right" style="display: none;">
	                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
	                </button>
	                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                 </div>
              </div>
            <!--搜索title  end --> 
            <div class="box-body">
			  <form id="searchForm" class="form-horizontal">
				<input type="hidden" name="pageName" value="bjtesale-buy-list.jsp"/>
				<input type="hidden" name="formName" value="searchForm1">
				<input type="hidden" name="trsBuy.w_delStatus" value="F">
				<input type="hidden" name="trsBuy.w_saleId" value="${param.saleId}"/>
				<input type="hidden" name="trsBuy.w_proId" value="${param.proId}"/>
				<input type="hidden" name="orderBy"  value="trsBuy.create_time desc" />
				
				<div class="form-group">
					<div class="col-sm-2 text_r"><label class="control-label" >商品代码：</label></div>
					<div class="col-sm-3">
						<input type="text" class="form-control" readonly="readonly"  value="${param.proNo}"/>
					</div>
					<div class="col-sm-2 text_r"><label class="control-label" >商品名称：</label></div>
					<div class="col-sm-3">
						<input type="text" class="form-control" readonly="readonly" value="${param.proName}"/>
					</div>
				</div>
				
				<div class="form-group">
					<div class="col-sm-2 text_r"><label class="control-label" >交易商账号：</label></div>
					<div class="col-sm-3">
						<input type="text" class="form-control clean"  name="trsBuy.wl_userName" value="" id="search_userName"/>
					</div>
					<div class="col-sm-2 text_r"><label class="control-label" >交易商名称：</label></div>
					<div class="col-sm-3">
						<input type="text" class="form-control clean"  name="trsBuy.wl_userRealName" value="" id="search_userRealName"/>
					</div>
                 </div>
				<center>
				   <div class="box-footer clearfix">
				       <button type="button" class="btn btn-success" onclick="getTableData();"><i class="fa fa-edit-circle"></i> 查询</button> 
				       <button  type="button" class="btn btn-warning" onclick="cleanData('searchForm');">重置 </button>
				   </div>
				</center>
			  </form>
            </div>
	     </div>
	     <!------- 搜索 end -------->
           
        <!------- 列表 start -------->
          <div class="box box-success">
            <!--列表title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-user"></i> 申购管理	查询结果</h3>
                 <button type="button" class="btn btn-success" onclick="window.history.back();"><i class="fa fa-arrow-circle-left"></i> 返回</button> 
                 <div class="box-tools pull-right" style="display: none;">
	                 　　　　　　　　<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
	                </button>
	                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                 </div>
              </div>
            <!--列表title  end --> 
              <div class="box-body">
                <table id="dataList" class="table table-bordered table-hover" >
                <thead class="bg-success">
                <tr>
                        <th class="text_c">序号</th>
                        <th class="text_c">活动名称</th><!-- 因为目前同一商品在同一时间段是可以多次发行不同活动的，在申购查看列表中是显示的同一商品的不同申购次数，没有区分活动，所以暂时显示此字段 -->
                        <th class="text_c">商品代码</th>
                        <th class="text_c">商品名称</th>
                        <th class="text_c">交易商账号</th>
                        <th class="text_c">交易商名称</th>
                        <th class="text_c">申购数量</th>
                        <th class="text_c">申购单价（元）</th>
                        <th class="text_c">申购时间</th>
                  		<th class="text_c">操作</th> 
                </tr>
                </thead>
                <tbody id="dataList-body">
                </tbody>
              </table>
              <center>
    	  		<ul id="dataList-page"></ul>
              </center>
            </div>
           </div>
        <!------- 列表 end -------->
        </div>
      </div>
    </section>
    <!-- Main end -->
  </div>
  <!-- /.content-wrapper -->
  <!-- foot start -->
  <%@include file="/common/sale/foot.jsp" %>
  <!-- foot start -->
  

<div class="modal fade" id="my_modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:900px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">信息添加</font> 
						</h4>
					</div>

					<div class="modal-body">
						
					       <div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="myTab">
					            </ul>
					            
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					                  
					               <div class="tab-pane active" id="tab_1">
					                  <form class="form-horizontal" role="form" id="addForm1" action="javascript:void(0)">
					                    <input type="hidden" name="pageName" value="bjtesale-buy-list.jsp"/>
										<input type="hidden" name="formName" value="addForm1"/>
									    <input type="hidden" id="addForm1_formToken" name="formToken" />
										<input type="hidden" name="doCode" value="dymicSql"/>
										
							                <!--trsBuy start-->
										<input type="hidden" name="trsBuy.delStatus" value="F"/>
										<input type="hidden" name="trsBuy.proId" value="${param.proId}"/>
										<input type="hidden" name="trsBuy.proNo" value="${param.proNo}"/>
											
						                	<div class="form-group col-sm-10">
												<label  class="class="col-sm-6"">交易商名称</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_userRealName" data-name="trsBuy.userRealName" name="trsBuy.userRealName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">中签数量</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_numReal" data-name="trsBuy.numReal" name="trsBuy.numReal" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">申购价格</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_price" data-name="trsBuy.price" name="trsBuy.price" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">手续费比例</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_commScale" data-name="trsBuy.commScale" name="trsBuy.commScale" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">状态</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_status" data-name="trsBuy.status" name="trsBuy.status" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">付款状态</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_payStatus" data-name="trsBuy.payStatus" name="trsBuy.payStatus" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">电话号码</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_tel" data-name="trsBuy.tel" name="trsBuy.tel" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">认购类型</label>
												<div class="col-sm-8">
						                			<select id="addForm1_trsBuy_rengouType" data-name="trsBuy.rengouType" name="trsBuy.rengouType" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=rengouType" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">认购时间</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_rengouTime" data-name="trsBuy.rengouTime" name="trsBuy.rengouTime" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">商品代码</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_proNo" data-name="trsBuy.proNo" name="trsBuy.proNo" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">申购数量</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_num" data-name="trsBuy.num" name="trsBuy.num" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">成交总价</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_totalPrice" data-name="trsBuy.totalPrice" name="trsBuy.totalPrice" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">交易商账号</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_userName" data-name="trsBuy.userName" name="trsBuy.userName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">最大申购数量</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_maxNum" data-name="trsBuy.maxNum" name="trsBuy.maxNum" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
											
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">最小申购数量</label>
												<div class="col-sm-8">
													<input type="text" id="addForm1_minNum" data-name="trsBuy.minNum" name="trsBuy.minNum" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
								        	<!--trsBuy end-->
								        
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
									         	<button class="btn btn-danger" type="button" style="width: 200px;" onclick="submitForm1('addForm1');"> 保存 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>	
			                
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>  

<div class="modal fade" id="my_modal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:800px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">信息修改</font> 
						</h4>
					</div>
					<div class="modal-body">
						<div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="myTab">
					            </ul>
					            
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					                  
					               <div class="tab-pane active" id="edit_tab_1">
					                  <form class="form-horizontal" role="form" id="editForm1" action="javascript:void(0)">
					                    <input type="hidden" name="pageName" value="bjtesale-buy-list.jsp"/>
										<input type="hidden" name="formName" value="editForm1"/>
									    <input type="hidden" id="editForm1_formToken" name="formToken" />
										<input type="hidden" name="doCode" value="dymicSql"/>
										
							                <!--trsBuy start-->
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">交易商名称</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_userRealName" data-name="trsBuy.userRealName" name="trsBuy.userRealName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
											
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购数量</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_num" data-name="trsBuy.num" name="trsBuy.num" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">中签数量</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_numReal" data-name="trsBuy.numReal" name="trsBuy.numReal" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购价格</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_price" data-name="trsBuy.price" name="trsBuy.price" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">手续费比例</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_commScale" data-name="trsBuy.commScale" name="trsBuy.commScale" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">状态</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_status" data-name="trsBuy.status" name="trsBuy.status" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">付款状态</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_payStatus" data-name="trsBuy.payStatus" name="trsBuy.payStatus" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">付款类型</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_payStyle" data-name="trsBuy.payStyle" name="trsBuy.payStyle" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">电话号码</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_tel" data-name="trsBuy.tel" name="trsBuy.tel" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">认购类型</label>
												<div class="col-sm-6">
						                			<select id="editForm1_trsBuy_rengouType" data-name="trsBuy.rengouType" name="trsBuy.rengouType" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=rengouType" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">认购时间</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_rengouTime" data-name="trsBuy.rengouTime" name="trsBuy.rengouTime" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">商品代码</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_proNo" data-name="trsBuy.proNo" name="trsBuy.proNo" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购总额</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_moneyApply" data-name="trsBuy.moneyApply" name="trsBuy.moneyApply" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">交易商账号</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_userName" data-name="trsBuy.userName" name="trsBuy.userName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<!-- <div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">最大申购数量</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_maxNum" data-name="trsBuy.maxNum" name="trsBuy.maxNum" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">最小申购数量</label>
												<div class="col-sm-6">
														<input type="text" id="editForm1_minNum" data-name="trsBuy.minNum" name="trsBuy.minNum" class="form-control clean"  placeholder="必填项" />
												</div>
											</div> -->
											
								        	<!--trsBuy end-->
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
									         	<button class="btn btn-danger" type="button" style="width: 200px;" onclick="submitForm1('editForm1');"> 保存 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>	
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>  

<div win-title="查看窗口" class="modal fade" id="my_modal_view" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:800px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">查看详情</font> 
						</h4>
					</div>
					<div class="modal-body">
						<div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="viewmyTab">
					            </ul>
					            
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					                  
					               <div class="tab-pane active" id="view_tab_1">
					                  <form class="form-horizontal" role="form" id="viewForm1" action="javascript:void(0)">
							                <!--trsBuy start-->
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">交易商名称：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.userRealName"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购数量：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.num"></span>
												</div>
											</div>
											<!-- 
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">中签数量</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.numReal"></span>
												</div>
											</div>
											 -->
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购价格：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.price"></span> 元
												</div>
											</div>
											<!--
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">手续费比例</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.commScale"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">状态</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.status"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">付款状态</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.payStatus"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">付款类型</label>
												<div class="col-sm-6 control-label1">
						                			<span data-name="trsBuy.payStyle" data-url=""></span>
												</div>
											</div>
											 
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">电话号码</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.tel"></span>
												</div>
											</div>
											 -->
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">认购类型：</label>
												<div class="col-sm-6 control-label1">
						                			<span data-name="trsBuy.rengouType" data-url="doCode=dictItemList&cateEname=rengouType"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购时间：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.createTime"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">商品代码：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.proNo"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">申购总额：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.moneyApply"></span> 元
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">交易商账号：</label>
												<div class="col-sm-6 control-label1">
													<span data-name="trsBuy.userName"></span>
												</div>
											</div>
											
						                	<!-- <div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">最大申购数量</label>
												<div class="col-sm-6">
													<span data-name="trsBuy.maxNum"></span>
												</div>
											</div>
											
						                	<div class="form-group col-sm-6">
												<label  class="col-sm-6 control-label">最小申购数量</label>
												<div class="col-sm-6">
													<span data-name="trsBuy.minNum"></span>
												</div>
											</div> -->
											
								        	<!--trsBuy end-->
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
									         	<button class="btn btn-danger" type="button" style="width: 200px;" onclick="cannel('view');"> 关闭 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>	
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>
</body>


<!-- 以下是template列表模板的模块区域 -->
<script type="text/template" id="dataList-template">
		<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td class="text_c"><?=(pageObj.currentPage-1)*10+(i+1)?></td>
			<td class="text_l"><?=strUtil.doNull(rows[i].saleName,'')?></td>
			<td class="text_c"><?=strUtil.doNull(rows[i].proNo,'')?></td>
			<td class="text_c"><?=strUtil.doNull(rows[i].proName,'')?></td>
			<td class="text_c"><?=strUtil.doNull(rows[i].userName,'')?></td>
			<td class="text_c"><?=strUtil.doNull(rows[i].userRealName,'')?></td>
			<td class="text_r"><?=strUtil.doNull(rows[i].num,'')?></td>
			<td class="text_r">￥<?=fmoney(rows[i].price,'')?></td>
			<td class="text_c"><?=strUtil.doNull(rows[i].createTime,'')?></td>
            <td>
					<button type="button" class="btn btn-warning btn-xs" onclick="toViewPeiHao('<?=rows[i].saleId?>')">查看配号结果</button> 
					<!--<button type="button" class="btn btn-success btn-xs" onclick="toLoad1('<?=rows[i].buyId?>','view')">查看</button> --> 
					<!--<button type="button" class="btn btn-warning btn-xs" onclick="toLoad1('<?=rows[i].buyId?>','edit');">修改</button>  
					<button type="button" class="btn btn-danger btn-xs" onclick="toDele('<?=rows[i].buyId?>');">删除</button>-->
			</td>
		</tr>
   <?}?>  		
</script>

</html>

<!-- 以下是js模块区域 -->
<script>
var clickMenu = "bjtesale-sale-list";
var id,myPage,dataListId,searchFormId,isShowLog,tableSort,tableId;
myPage = 10;
dataListId = "dataList";
searchFormId = "searchForm";
tableSort = "trsBuy";
tableId = "buyId";
isShowLog = true;

$(function () {
	//1、加载分页列表数据
	getTableData();
	//2、控制是否启用token
	//setToken();
	
	//请在下面补充其他初始化方法（如数据字典、页面加载数据等）
	//3、初始化数据字典
	DictUtil.getCommonDictData("select","#addForm1_trsBuy_payStyle","trsBuy.payStyle","","","");
	DictUtil.getCommonDictData("select","#addForm1_trsBuy_rengouType","trsBuy.rengouType","doCode=dictItemList&cateEname=rengouType","","");
 });
var dateObject = $('.datepicker').datepicker( {
	language : 'zh-CN',
	//inline: true,
	todayBtn : "linked",
	format : "yyyy-mm-dd",
	autoclose: true
});
//toLoad1 读取（查询、编辑）数据
function toLoad1(id,type){
	var paramLoadData = {"formName":"searchForm1","pageName":"bjtesale-buy-list.jsp","trsBuy.w_buyId":id};
	showModal(type);
	$.ajax({
	    type:'get',
	   	url:common_info_url+"?doCode=dymicSql",
	    data: paramLoadData,
	    async:false,
	    dataType:"json",
	    success: function(myData){
	    	console.log(myData);
	    	
			//FormUtil.loadView("trsBuy", myData.trsBuy);
			FormUtil.loadView("trsBuy", myData);
			DictUtil.getCommonDictData("select","#editForm1_trsBuy_rengouType","trsBuy.rengouType","doCode=dictItemList&cateEname=rengouType","",myData.rengouType);
			 
	  	}
	});
}

function toDele(id){
	var index_submit = layer.confirm('您确定要删除信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		var paramLoadData = {"pageNme":"trs-buy","forName":"delForm","trsBuy.w_buyId":id};
		//var paramLoadData = {"modelTypes":"u_trsBuy","trsBuy.delStatus":"T","trsBuy.w_buyId":id};
		doDele(paramLoadData);
	});
}
//弹框
function showModal(type){
	if("view"==type){
		$("#my_modal_view").modal("show");
	}else if("edit"==type){
		//修改弹框时，初始化数据字典
		cleanData('editForm1');
		DictUtil.getCommonDictData("select","#editForm1_trsBuy_rengouType","trsBuy.rengouType","doCode=dictItemList&cateEname=rengouType","","");
		$("#my_modal_edit").modal("show");
	}
}

$(function () {
	$('#'+dataListId+' tbody').on('click','tr', function (e) {
	     if ( $(this).hasClass('selected') ) {
	            //$(this).removeClass('selected');
	        }
	        else {
	            $('tr.selected').removeClass('selected');
	            $(this).addClass('selected');
	        }
	     id = $('tr.selected td').eq(0).html();
	   //  console.log($('tr.selected td').eq(1).html())
	} );
	
	
  });
//加载列表数据
function getTableData(){
	deleteAllRow(dataListId);
	//搜索框去除空格
	$("#search_userName").val($("#search_userName").val().trim());
	$("#search_userRealName").val($("#search_userRealName").val().trim());
	
	$.ajax({
		   type:'get',
		   url:common_list_url,
		   data:$("#"+searchFormId).serialize()+getCurrentPage(common_list_url+"?"+$("#"+searchFormId).serialize(),myPage),
		   dataType:'json',
		   success: function(myData){
		   if(isShowLog)console.log(myData);
			var data = baidu.template(dataListId+"-template",eval(myData));  
			$("#"+dataListId+"-body").html(data);
			  var option= {
					   ele:$("#"+dataListId+"-page")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$("#"+searchFormId).serialize()
				   }
				generatePages(option);
		   }
		});	
  }

//设置模态框隐藏事件 
$( '#my_modal_add' ).on( 'show.bs.modal' ,function(e){  
	setToken();
}); 
//清空数据
function cleanData(id){
	$('#'+id).find(".clean").val("");//按照样式清空；
}
//打开添加页面
function toAdd(){
	cleanData('addForm1');//清空模态窗口内数据
	$("#w_"+tableId).val("");
	$(".datepicker").val("");
	$('#my_modal_add').modal('show');
}

//获取对象值
function loadObj(type,paramData){
	$.ajax({
	    type:'get',
	   	url:common_info_url+"?doCode=dymicSql",
	    data: paramData,
	    async:false,
	    dataType:"json",
	    success: function(myData){
	    	showData(type,myData);
	  	}
	});	
}

//删除信息（逻辑删除）
function doDele(paramData){
	$.ajax({
	    type:"post",
	    url:common_submit_url+"?doCode=dymicSql",
	    data: paramData,
	    dataType:"json",
	    success: function(myData){
	    	var result = myData.flag;
	    	if(result=="T"){
	    		layer.alert("删除操作成功");
	    		refresh();
	    	}
	  	}
	});	
}


function submitForm1(formId,tabId){

	var result = submitForm(formId,tabId);
	if(result){
		if(result.flag=='T'){
    		var num = formId.slice(-1);
    		if(num!=null &&　num !=""){
    			num=parseInt(num)+1;
    			defaultTab = "#tab_"+num;
    		}
      		layer.alert('操作成功！', {closeBtn: 0 });
      		//setToken();
      		//if(tabId!=null && tabId!=""){
      		//	tabId = "#"+tabId;
      		//	$('#myTab a[href=\"'+tabId+'\"]').tab('show'); // Select tab by name 
      		//}
      		refresh();
      		cannel('');
      		cannel('edit');
	     }
	}
 }
	

 

function submitForm(formId,tabId){
	var result;
	if(tabId!=null && tabId!="" && tabId!="undefined"){
		//$('#'+formId).data('bootstrapValidator').validate();  
		//if(!$('#'+formId).data('bootstrapValidator').isValid()){  
		//    return ;  
		//}  
	}else{
		var proName = $("#"+formId+"_proName").val();
		//if(proName==null || proName==""){
		//	layer.alert('项目名称不能为空！', { closeBtn: 0 });
		//	return ;
		//}
	}
	var index_load = layer.load(1, {shade: false});
	$.ajax({
	    type:'post',
	    url:common_submit_url,
	    data:$("#"+formId).serialize(),
	    async:false,
	    dataType:'json',
	    success: function(myData){ 
	     console.log(myData);
	        if(myData.flag=="T"){
		        result = myData;
		        if(myData.ids){
		           // proId = primaryId;
		        	////myData.ids={myData.ids.trpPro_proId=?;myData.ids.trpPub_pubId=?;myData.ids.pubLandContract_infoId=?}
		        	//for(var objstr in myData.ids){
		        		////alert(objstr.replace('_','w_')+"-"+myData.ids[objstr]);
		        	//	var pkName = objstr.replace('_','.w_');
		        	//	$("input[name='"+pkName+"'").val(myData.ids[objstr]);
		        	//}
		        	
		        }
	    	}else{
	    		setToken();
	     		layer.alert(myData.msg, {
	    		    closeBtn: 0
	    		  });
	    	}
	        layer.close(index_load);

	  	},
	     error: function (e) {
		     layer.close(index_load);
     	} 
	});	
	return result;
}



//关闭win
function cannel(type){
	if(strUtil.isNull(type)){
		$('#my_modal_add').modal('hide');
	}else{
		$('#my_modal_'+type).modal('hide');
	}
}

function refresh(){
	getTableData();
}


function setToken(){
	$.ajax({
	    type:'get',
	    url:'/sendPage/token?token=true',
	    dataType:'text',
	    success: function(myData){
	    	console.log(myData);
			$('#addForm_formToken').val(myData);
			$('#editForm_formToken').val(myData);
	  	}
	});	
}

function toViewPeiHao(saleId){

	  var url ="${page_admin}/sale/sale-yaohao-list?saleId="+saleId+"&proNo=${param.proNo}&proName=${param.proName}";	
	  window.location.href=encodeURI(url);

}

/****  以下是自定义新增方法  ****/
 
</script>



